﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;

namespace UI.Validadores
{
    public class UsuarioValidator
    {
        private static readonly string patronEmail = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

        private static readonly Regex expRegEmail = new Regex(patronEmail);

        private static readonly string patornLetrasYEspacio = @"^[a-zA-Z\s]*$";

        private static readonly Regex expRegLetrasYEspacio = new Regex(patornLetrasYEspacio);

        private static readonly string patornAlfaNumerico = @"^[a-zA-Z0-9]*$";

        public bool ValidarEmail(string email) {
            return expRegEmail.IsMatch(email);
        }

        public bool ValidarSoloLetras(string palabra) {
            return expRegLetrasYEspacio.IsMatch(palabra);
        }

    }
}